<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ include file="/common/base.jsp"%>
<%
	AreaDao dao = new AreaDao();
	String sql ="select * from t_area ";
	Object[]params={};
	List<Area> areaList = dao.queryOjects(sql, params);
	
 %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport"
	content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta name="renderer" content="webkit">
<link rel="stylesheet" type="text/css" href="css/styles.css">
<link rel="stylesheet" type="text/css" href="css/admin.css">

<script type="text/javascript" src="js/jquery-1.4.4.min.js"></script>
<script type="text/javascript" src="js/admin.js"></script>
<!-- 引入第三方日期JS组件 -->
<script type="text/javascript" src="third/laydate/laydate.js"></script>
<script type="text/javascript" src="js/admin.js"></script>
<script type="text/javascript">
	$(document).ready(function() {
		//重新绑定表单提交
		$("#add_btn").bind("click", function() {
			$('form').submit();
		});
	});
	
	function cascade(){
	
		var area=$("#area").find("option:selected").text();
		$("#address").val(area);
		
	}

</script>

</head>

<body>
	<div class="panel admin-panel">
		<div class="panel-head" id="add">
			<strong><span class="icon-pencil-square-o"></span>增加户基本信息</strong>
		</div>
		<div class="body-content">
			<form id="form-add" method="post" class="form-x"
				action="<%=path%>/system/FamilyServlet?m=add">
 			
				<div class="form-group">
					<div class="label">
						<label>所属行政区域：</label>
					</div>
					<div class="field">
						<select id="area" class="input w50" name="area">
						<%
							for(Area a : areaList){
						 %>
							<option value="<%=a.getAreacode()%>,<%=a.getGrade()%>">
							 <%
						  
						  for(int i=0;i<a.getGrade();i++){
							 if(i==0){
								 out.print("|-"); 
							 }else{
								 out.print("-");
							 }
							  
						  } %>
							<%=a.getAreaname() %></option>
							
							<%} %>
							
						</select>
						<div class="tips"></div>
					</div>
				</div>
				
				
				<div class="form-group">
					<div class="label">
						<label>户主姓名：</label>
					</div>
					<div class="field">
						<input type="text" class="input" value="" name="housemaster"
							data-validate="required:请输入户主姓名" />
						<div class="tips"></div>
					</div>
				</div>
									
				<div class="form-group">
					<div class="label">
						<label>家庭住址：</label>
					</div>
					<div class="field">
						<input type="text" class="input" name="address" id="address" class="input w50"
							style="height:100px;"/>
					</div>
				</div>

				<div class="form-group">
					<div class="label">
						<label>创建时间：</label>
					</div>
					<div class="field">
						<input name="createtime" class="input" type="text" id="today" readonly="readonly">
					</div>
				</div>
				
				<div class="form-group">
					<div class="label">
						<label>身份证号：</label>
					</div>
					<div class="field">
						<input type="text" class="input" value="" name="idcard"
							data-validate="required:输入身份证号" />
						<div class="tips"></div>
					</div>
				</div>
				<div class="form-group">
					<div class="label">
						<label>性别：</label>
					</div>
					<div class="field">
						<div class="button-group radio">

							<label class="button active"> <span
								class="icon icon-check"></span> <input name="status" value="女"
								type="radio" checked="checked">女
							</label> <label class="button active"><span
								class="icon icon-times"></span> <input name="stauts" value="男"
								type="radio" checked="checked">男 </label>
						</div>
					</div>
				</div>

				<div class="form-group">
					<div class="label">
						<label>出生日期：</label>
					</div>
					<div class="field">
					<input type="text" class="input" value="" name="birthday" id="birthday" />
					</div>
				</div>
					   
				<div class="form-group">
					<div class="label">
						<label>民族：</label>
					</div>
					<div class="field">
						<input type="text" class="input" value="" name="nation"
							data-validate="required:输入民族" />
						<div class="tips"></div>
					</div>
				</div>
				<div class="form-group">
					<div class="label">
						<label>健康状况：</label>
					</div>
					<div class="field">
						<select name="health" class="input">
							<option value="健康">健康</option>
							<option value="一般">一般</option>
							<option value="较差">较差</option>
						</select>
						<div class="tips"></div>
					</div>
				</div>
				<div class="form-group">
					<div class="label">
						<label>文化程度：</label>
					</div>
					<div class="field">
						<select name="culture" class="input">
							<option value="博士">博士</option>
							<option value="硕士">硕士</option>
							<option value="本科">本科</option>
							<option value="专科">专科</option>
							<option value="高中">高中</option>
							<option value="初中">初中</option>
							<option value="小学">小学</option>
							<option value="文盲与半文盲">文盲与半文盲</option>
						</select>
						<div class="tips"></div>
					</div>
				</div>

				<div class="form-group">
					<div class="label">
						<label>人员属性：</label>
					</div>
					<div class="field">
						<select name="relationship" class="input">
							<option value="一般户">一般户</option>
							<option value="民政救助对象">民政救助对象</option>
						</select>
						<div class="tips"></div>
					</div>
				</div>

				<div class="form-group">
					<div class="label">
						<label>是否农业户口：</label>
					</div>
					<div class="field">
						<div class="button-group radio">

							<label class="button active"> <span
								class="icon icon-check"></span> <input name="farmer" value="是"
								type="radio" checked="checked">是
							</label> <label class="button active"><span
								class="icon icon-times"></span> <input name="farmer" value="否"
								type="radio" checked="checked">否</label>
						</div>
					</div>
				</div>

				<div class="form-group">
					<div class="label">
						<label>婚姻状况：</label>
					</div>
					<div class="field">
						<select name="marriage" class="input">
							<option value="未婚">未婚</option>
							<option value="已婚">已婚</option>
							<option value="离婚">离婚</option>
							<option value="丧偶">丧偶</option>
						</select>
						<div class="tips"></div>
					</div>
				</div>

				<div class="form-group">
					<div class="label">
						<label>工作单位：</label>
					</div>
					<div class="field">
						<textarea type="text" class="input" name="work"
							style="height:100px;"></textarea>
					</div>
				</div>
				<div class="form-group">
					<div class="label">
						<label>联系电话：</label>
					</div>
					<div class="field">
						<input type="text" class="input" value="" name="phone"
							data-validate="required:输入电话" />
						<div class="tips"></div>
					</div>
				</div>

				<div class="form-group">
					<div class="label">
						<label></label>
					</div>
					<div class="field">
						<button id="add_btn" class="button bg-main icon-check-square-o"
							type="button">提交</button>
					</div>
				</div>
			</form>
		</div>
	</div>

</body>


<script type="text/javascript">
	
	function today(){
    var today=new Date();
    var h=today.getFullYear();
    var m=today.getMonth()+1;
    var d=today.getDate();
    return h+"-"+m+"-"+d;
    }
    
    document.getElementById("today").value = today();
</script>


<!--渲染JS日期组件 -->
<script type="text/javascript">
 laydate.render({
  elem: '#birthday'
});
</script>
</html>
